<template>
  <view class="logo-box" v-if="hasLogo">
    <img class="logo-img" :src="logoInfo.imageLinks" @click="logoTarget(logoInfo)" />
    <view class="logo-text">{{ logoInfo.des }}</view>
    <view class="logo-text">{{ logoInfo.remark }}</view>
  </view>
  <!-- <view class="logo-box" v-else>
    <img class="logo-img" src="../../static/images/logo.png" />
  </view> -->
</template>

<script>
import { getMallListApi } from "@/http/api";
export default {
  name: "yipu-logo",
  data() {
    return {
      hasLogo: false,
      logoInfo: {},
    };
  },
  mounted() {
    // 获取ad信息
    getMallListApi({
      pageNum: 1,
      pageSize: 999,
      status: 1,
      category: 99,
    }).then((res) => {
      if (res.code == 200 && res.rows.length > 0) {
        this.logoInfo = res.rows[0];
        this.hasLogo = true;
      } else {
        this.hasLogo = false;
      }
    });
  },
  methods: {
    logoTarget(item) {
      if (item.skipLinks) {
        window.location.href = item.skipLinks;
      }
    },
  },
};
</script>

<style scoped>
.logo-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 38rpx 0;
}
.logo-img {
  width: 100rpx;
  height: 100rpx;
}
.logo-text {
  color: #808080;
  font-size: 26rpx;
}
</style>
